﻿// Decompiled with JetBrains decompiler
// Type: Netick.NetworkCollectionChangedIds
// Assembly: Netick, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 6726ECA1-C773-4CF7-8952-E81B30D93B52
// Assembly location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.dll
// XML documentation location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.xml

using System;
using System.Runtime.CompilerServices;

#nullable disable
namespace Netick;

internal static class NetworkCollectionChangedIds
{
  internal static int[] ChangedIds = new int[100];
  internal static int Count;

  [MethodImpl(MethodImplOptions.AggressiveInlining)]
  internal static void Add(int id)
  {
    if (NetworkCollectionChangedIds.Count + 1 > NetworkCollectionChangedIds.ChangedIds.Length)
    {
      int[] destinationArray = new int[NetworkCollectionChangedIds.ChangedIds.Length * 2];
      Array.Copy((Array) NetworkCollectionChangedIds.ChangedIds, (Array) destinationArray, NetworkCollectionChangedIds.Count);
      NetworkCollectionChangedIds.ChangedIds = destinationArray;
    }
    NetworkCollectionChangedIds.ChangedIds[NetworkCollectionChangedIds.Count++] = id;
  }

  internal static void Clear() => NetworkCollectionChangedIds.Count = 0;
}
